home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / batch / inpt15 / input.doc < prev    next >
Encoding:
Text File  |  1991-10-30  |  11.8 KB  |  306 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.        
  8.        INPUT.EXE 1.5
  9.        Copyright 1991 by Chuck Steenburgh
  10.        
  11.           If you use batch files very often, you've probably acquired
  12.        a program called ASK.COM or QUERY.COM or something similar 
  13.        that allows you to ask questions and receive simple respones.
  14.        Usually, this involves typing an ECHO command with your
  15.        question, followed by ASK.COM or whatever.  If you do this
  16.        alot, you will probably appreciate the fact the INPUT.EXE
  17.        will accomplish the jobs of both the ECHO and ASK commands.
  18.        Add to this the greater flexibility that INPUT.EXE offers
  19.        in presenting your prompt to the user and in receiving input,
  20.        and you'll be sold.
  21.        
  22.        Usage: INPUT ["prompt"] [color] [/C] [/I] [/S] [/Y | /N] [/Pd] |
  23.        
  24.                  "prompt"        Enter the text you would like to
  25.                                  appear to prompt the user for
  26.                                  input.  This can be up to 59 char-
  27.                                  acters and must be enclosed in
  28.                                  quotation marks.
  29.        
  30.                  color           Enter a number representing the
  31.                                  color in which you want your mes-
  32.                                  sage to appear.  You must, of
  33.                                  course, have a color monitor and
  34.                                  card.  See Appendix 3.
  35.        
  36.                  /C              Include this switch if you want
  37.                                  your prompt message centered on
  38.                                  the current line.  If you include
  39.                                  this switch, you MUST include a
  40.                                  color value.
  41.                                  
  42.                  /I              Use this for a case-insensitive error
  43.                                  level return.  If this switch is
  44.                                  included on the command line, pressing
  45.                                  a letter a-z (lower case) will return
  46.                                  the same value as if the corresponding
  47.                                  key A-Z (upper case) were pressed.
  48.                                  
  49.                  /S              Show keypress.  Adding this switch
  50.                                  will cause INPUT to display the
  51.                                  errorlevel value returned.  Use this
  52.                                  for quick "debugging" of your use
  53.                                  of INPUT.EXE
  54.                                  
  55.                  /Y              Use this for a yes-no only response.  
  56.                                  If the "n" key is pressed, errorlevel 
  57.                                  of "0" is returned; pressing any other
  58.                                  key returns an errorlevel of 1.  The  
  59.                                  prompt "(Y/n)" is appended to the nor-
  60.                                  mal prompt specified by the user.     
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                                  
  69.                  /N              Use this for a yes-no only response.  
  70.                                  If the "y" key is pressed, errorlevel 
  71.                                  of "1" is returned; pressing any other
  72.                                  key returns an errorlevel of 0.  The  
  73.                                  prompt "(y/N)" is appended to the nor-
  74.                                  mal prompt specified by the user.     
  75.                                  This switch takes precedence over the 
  76.                                  /y switch.                            
  77.                                  
  78.                  /Pd             Pause 10 seconds for user input, then |
  79.                                  default to "d" (where "d" is any char-|
  80.                                  acter.  INPUT will wait up 10 seconds |
  81.                                  for user input.  If no key is pressed |
  82.                                  within 10 seconds, INPUT will act as  |
  83.                                  if the key specified by the key rep-  |
  84.                                  resented by the single character "d"  |
  85.                                  was pressed.  Note that all other     |
  86.                                  switches (case insensitivity, yes/no  |
  87.                                  answer, etc.) remain active if time   |
  88.                                  expires and the default key is used.  |
  89.                                  INPUT adds a warning that it will de- |
  90.                                  fault to the specified value after 10 |
  91.                                  seconds, and will display a succession|
  92.                                  of ten dots to indicate elapsed time. |
  93.                                  
  94.                  The command line parameters may be entered in any
  95.                  order, may be in any case, and may be preceded by 
  96.                  either the "/" or "-" character.     
  97.        
  98.        Examples:
  99.        
  100.             INPUT "Select a number from one to 10"
  101.        
  102.             This prints the text "Select on number from one to 10"
  103.        on the current line and waits for a keypress.
  104.        
  105.             INPUT "Press any key to continue" 79
  106.        
  107.             This prints the text "Press any key to continue" on the
  108.        current line in bright white on a red background and waits
  109.        for a keypress.
  110.        
  111.             INPUT "Press the space bar to exit" 143 /c
  112.        
  113.             This prints the text "Press the space bar to exit" cen-
  114.        tered on the current line in flashing bright white on a black
  115.        background.
  116.        
  117.             INPUT /s /i "Press any key..." /c 14
  118.             
  119.             Prompts user with "Press any key..." in yellow on black.
  120.        Returns a case-insensitive errorlevel and displays it on the
  121.        screen before terminating.
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.        
  130.             INPUT "Do you wish to continue?" /s 79 /y              
  131.             
  132.             Prompts user with "Do you wish to continue? (Y/n)" in 
  133.        white on red.  Returns errorlevel of 1 unless the "n" key is
  134.        pressed.  Displays errorlevel on screen.
  135.        
  136.             INPUT "Press any key..." /pf                               |
  137.             
  138.             Prompts user with "Press any key... (defaults to f after   |
  139.        10 seconds)" in black on white.  Returns errorlevel of 102 if   |
  140.        no key is pressed within 10 seconds, otherwise returns value of |
  141.        key pressed.
  142.        
  143.             INPUT "Press any key..." /c /pf                            |
  144.             
  145.             Prompts user with "Press any key... (defaults to f after   |
  146.        10 seconds)" in black on white.  Returns errorlevel of 70 if no |
  147.        key is pressed within 10 seconds, otherwise returns the upper   |
  148.        case ASCII value of the key pressed.                            |
  149.        
  150.           INPUT will also sound an alarm to let the user know that
  151.        a response is expected.
  152.        
  153.           When a key is pressed, INPUT will set the errorlevel equal
  154.        to the ASCII value of the key pressed.  This is slightly dif-
  155.        ferent from BATBOX in that in normal operation INPUT is case
  156.        sensitive and will allow you to distinguish between upper and
  157.        lower case letters.  If you want a case-insensitive return, use
  158.        the /i switch.  See Appendix 2 for a complete list of the ASCII
  159.        characters theoretically supported by INPUT.
  160.        
  161.           If you want greater control over the placement of your prompt
  162.        message on the screen, use WRITE in conjunction with INPUT.
  163.        Use WRITE to display your prompt then use INPUT without the
  164.        "prompt," color, or /c parameters.
  165.        
  166.        
  167.           INPUT is part of STEENBURGH'S STUFF Mildly Useful Utilities.
  168.        STEENBURGH'S STUFF includes the following programs:
  169.        
  170.             BATBOX:     Simple menu creation/input system
  171.             CLK:        Displays time on screen
  172.             FREEDISK:   Checks for available disk space
  173.             INPUT:      Simple prompt/input system
  174.             KLS:        Colorful screen-clearing utility
  175.             LAUNCHER:   File selection/execution system
  176.             MUSIC:    Plays transcribed sheet music on the PC
  177.             RAND:       Random number generator
  178.             SKIP:       Prints blank lines from batch files
  179.             SOUNDER:    Wide range of noise making options
  180.             WAITFOR:    Timed pauses 
  181.             WHENISIT:   Date/time telling utility
  182.             WRITE:      Colorful output anywhere on screen
  183.  
  184.                                      Page 3
  185.  
  186.  
  187.  
  188.  
  189.  
  190.             XD:         Create/switch directories at the same time
  191.        
  192.           The current version of STEENBURGH'S STUFF is 1.5, and can
  193.        be found on many BBS's as STUF15.ZIP (earlier versions include
  194.        STUF14.ZIP, STUF13.ZIP, etc.).  It can also be found on Compu-
  195.        Serve in the IBMSYS libraries.
  196.        
  197.        DISCLAIMER
  198.        
  199.           The programs described in this documentation are guaran-
  200.        teed to absolutely nothing!  They have, however, in my exper-
  201.        ience performed essentially as described herein.  The author
  202.        will not be responsible for any loss or damages caused through
  203.        the use of these programs.
  204.        
  205.           All trademarks are property of their respective owners.
  206.        
  207.           The programs and documentation are Copyright 1991 by Chuck
  208.        Steenburgh.  You are encouraged to distribute these programs
  209.        provided the following conditions are met:
  210.        
  211.           - all files contained in this archive must be distrib-
  212.             uted together in UNMODIFIED form
  213.        
  214.           - you charge no more than a reasonable fee for copying or
  215.             subscription, and clearly indicate that payment of such
  216.             a fee does NOT grant ownership of the programs.
  217.        
  218.           You may evaluate these programs for up to 30 days on a free
  219.        trial basis.  After 30 days, you should register your use of
  220.        these programs.  The registration fee is $10, payable to the
  221.        author at the address given below.  This registration fee in-
  222.        cludes registration of ALL the programs described above as
  223.        part of STEENBURGH'S STUFF.
  224.        
  225.           Let's be real: I don't plan to make alot of money this way.
  226.        Registration does have its advantages:
  227.        
  228.           - I am improving these programs all the time.  Registration
  229.             will get you IMMEDIATELY a disk with the latest version,
  230.             which includes a version of BATBOX with user-selected 
  231.             menu colors.  When Version 2.0 of these utilities is re-
  232.             leased, you will also receive that free of charge.
  233.        
  234.           - While I can't promise to include everyone's suggestions
  235.             in program updates, you can bet I'll listen to registered
  236.             users before any of you scrounges out there.
  237.        
  238.           - You will me feel all warm and fuzzy and appreciated, and
  239.             all that good stuff.
  240.        
  241.           - You will also get an evaluation copy of my text-file for-
  242.             matting program (used to produce the margins in this doc-
  243.             ument).
  244.  
  245.                                      Page 4
  246.  
  247.  
  248.  
  249.  
  250.  
  251.        
  252.           Send comments/registrations to:
  253.        
  254.                Chuck Steenburgh
  255.                304A North Main Street
  256.                Lexington, VA 24450
  257.                (703)464-5290
  258.        
  259.                CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
  260.        
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.                                      Page 5